#include <iostream>
#include <type_traits>
class Animal {
  public:
    Animal(double lenth = 50, double weight = 20, char sex = 'm');
    virtual ~Animal() = default;
    virtual void setInfo(double lenth, double weight, char sex);
    virtual void display(void);

  protected:
    double bodyLenth;
    double bodyWeight;
    char gender;
};

Animal::Animal(double lenth, double weight, char sex) {
    bodyLenth = lenth;
    bodyWeight = weight;
    gender = sex;
}

void Animal::setInfo(double lenth, double weight, char sex) {
    bodyLenth = lenth;
    bodyWeight = weight;
    gender = sex;
}

void Animal::display() {
    std::cout << "height:" << bodyLenth << std::endl;
    std::cout << "weight:" << bodyWeight << std::endl;
    std::cout << "sex:" << gender << std::endl;
}

class TerAnimal : virtual public Animal {
  public:
    TerAnimal(double lenth = 50, double weight = 20, char sex = 'm',
              double speed = 120)
        : Animal(lenth, weight, sex) {
        RunningSpeed = speed;
    }
    virtual ~TerAnimal() override = default;
    virtual void setInfo(double lenth, double weight, bool sex, double ruspeed);
    virtual void display(void) override;

  private:
    using Animal::setInfo;

  protected:
    double RunningSpeed;
};

void TerAnimal::setInfo(double lenth, double weight, bool sex, double ruspeed) {
    setInfo(lenth, weight, sex);
    RunningSpeed = ruspeed;
}

void TerAnimal::display() {
    Animal::display();
    std::cout << "running_speed:" << RunningSpeed << std::endl;
}

class AquAnimal : virtual public Animal {
  public:
    AquAnimal(double lenth = 50, double weight = 20, char sex = 'm',
              double speed = 100)
        : Animal(lenth, weight, sex) {
        SwimmingSpeed = speed;
    }
    void setInfo(double lenth, double weight, char sex, double swspeed);
    virtual void display(void) override;

  private:
    using Animal::setInfo;

  protected:
    double SwimmingSpeed;
};

void AquAnimal::setInfo(double lenth, double weight, char sex, double swspeed) {
    setInfo(lenth, weight, sex);
    SwimmingSpeed = swspeed;
}

void AquAnimal::display() {
    Animal::display();
    std::cout << "swimming_speed:" << SwimmingSpeed << std::endl;
}

class AmpAnimal : public TerAnimal, public AquAnimal {
  public:
    AmpAnimal(double lenth = 50, double weight = 20, char sex = 'm',
              double swspeed = 100, double ruspeed = 120)
        : Animal(lenth, weight, sex) {
        SwimmingSpeed = swspeed;
        RunningSpeed = ruspeed;
    }
    void mmpSetInfo(double lenth, double weight, char sex, double swspeed,
                    double ruspeed);
    virtual void display(void) override;

  private:
    using Animal::setInfo;
};

void AmpAnimal::mmpSetInfo(double lenth, double weight, char sex,
                           double swspeed, double ruspeed) {
    Animal::setInfo(lenth, weight, sex);
    SwimmingSpeed = swspeed;
    RunningSpeed = ruspeed;
}

void AmpAnimal::display() {
    Animal::display();
    std::cout << "swimming_speed:" << SwimmingSpeed << std::endl;
    std::cout << "running_speed:" << RunningSpeed << std::endl;
}

int main() {
    AmpAnimal test;
    test.display();
    double lenth, weight, swspeed, ruspeed;
    char sex;
    std::cin >> lenth >> weight >> sex >> swspeed >> ruspeed;
    test.mmpSetInfo(lenth, weight, sex, swspeed, ruspeed);
    test.display();
    return 0;
}
